Previously the code in _accessPointAdded was iterating over the
the network list to find a good place, and at that time, added both
the network to the list and the item to the menu. When I refactored
to call queueCreateSection, I forgot to add code to insert the
network in the list.
Add it now, using the new Util.insertSorted function.
https://bugzilla.gnome.org/show_bug.cgi?id=666429
accessPoints: [ accessPoint ]
};
apObj.ssidText = ssidToLabel(apObj.ssid);
- needsupdate = true;
}
// check if this enables new connections for this group
}
}
- if (needsupdate) {
+ if (pos == -1 || needsupdate) {
+ if (pos != -1)
+ this._networks.splice(pos, 1);
+ pos = Util.insertSorted(this._networks, apObj, this._networkSortFunction);
+
this._clearSection();
this._queueCreateSection();
}